﻿using Caliburn.Micro;
using myapp.Events;
using myapp.Instances;
using myappcore.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace myapp.ViewModels
{
    /// <summary>
    /// Order Manager ViewModel
    /// </summary>
    public class OrderManagerViewModel : IBaseContentViewModel
    {
        #region Attribute
        private static OrderManagerViewModel _instance;
        private Possition _possition;
        #endregion

        #region Properties

        /// <summary>
        /// Order Group List View Model
        /// </summary>
        public Screen Left { get; set; }

        /// <summary>
        /// Order List View Model
        /// </summary>
        public Screen Right { get; set; }

        /// <summary>
        /// Possition
        /// </summary>
        public Possition Possition
        {
            get
            {
                return _possition;
            }
            set
            {
                if (null != value)
                {
                    _possition = value;
                    var view = Right as ItemListOfPossitionViewModel;
                    view.Possition = _possition;
                    NotifyOfPropertyChange(() => Possition);
                }
            }
        }

        /// <summary>
        /// Instance of OrderManagerViewModel
        /// </summary>
        public static OrderManagerViewModel Instance
        {
            get
            {
                if (null == _instance)
                {
                    _instance = new OrderManagerViewModel();
                }
                return _instance;
            }
        }
        #endregion

        #region Constructure
        private OrderManagerViewModel()
        {
            MainInstance.Instance.EventAggregator.Subscribe(this);

            DisplayName = "Order";
            Left = ItemManagerViewModel.Instance;            
            Right = ItemListOfPossitionViewModel.Instance;
        }
        #endregion

        #region Method

        #endregion



        public string FunctionCode()
        {
            throw new NotImplementedException();
        }

        public string Description()
        {
            throw new NotImplementedException();
        }
    }
}
